from django.contrib import admin
from bamboo.models import User,Article,ver_email,Art_comment,Dian_zan
# Register your models here.

# class BaseAdmin(admin.ModelAdmin):
#     class Media:
#         js = {
#             'plugins/jquery1.12.4.min.js',
#             'js/admin.js',
#         }

class UserAdmin(admin.ModelAdmin):
    list_display=['id','username','phone']

class ArticleAdmin(admin.ModelAdmin):
    list_display=['id','title','author','article_views','comment','fabulous','mod_date']
    list_display_links = ['title']
    class Media:
        js = (
            'js/kindeditor/kindeditor-all.js',
            'js/kindeditor/lang/zh_CN.js',
            'js/kindeditor/config.js'
        )

class Ver_email(admin.ModelAdmin):
    list_display=['id','user','code']

class Art_commentAdmin(admin.ModelAdmin):
    list_display = ['id', 'art_id', 'user_id', 'send_obj', 'content', 'com_time']
    list_display_links = ['content']

class Dian_zanAdmin(admin.ModelAdmin):
    list_display = ['id', 'stutas', 'artid', 'userid', 'times']
    list_display_links = ['stutas']

admin.site.register(User,UserAdmin)
admin.site.register(Article,ArticleAdmin)
admin.site.register(ver_email,Ver_email)
admin.site.register(Art_comment,Art_commentAdmin)
admin.site.register(Dian_zan,Dian_zanAdmin)